package com.example.demo.Controll.child;

import com.example.demo.Serve.MysqlDeleteServe;
import com.example.demo.Serve.MysqlGetServe;
import com.example.demo.privateObj.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class MysqlControllerGet {
    @Qualifier("getServe")
    @Autowired
    private MysqlGetServe mysqlServe;
    @RequestMapping("/list")
    public List<User> getreq(){
        return mysqlServe.GetSelectServe("张");
    }
    @Qualifier("deleteServe")
    @Autowired
    private MysqlDeleteServe mysqlDeleteServe;
    @RequestMapping("/delete")
    public String deletereq(String name){
        System.out.println(name);
        mysqlDeleteServe.DeleteName(name);
        return "成功";
    }
}
